package console4.widgets;

import java.io.File;
import java.io.Serializable;
import java.util.List;

import org.eclipse.swt.custom.StyleRange;

public class TabSaveState implements Serializable {

	private static final long serialVersionUID = -5265079519477922549L;
	
	private final String text;
	private final int[] textLayout;
	private final List<String> oldCommands;
	private final File currentPath;

	public TabSaveState(String text, StyleRange[] textLayout, List<String> oldCommands, File currentPath) {
		this.text=text;
		this.textLayout=new int[textLayout.length*2];
		for(int i=0;i<textLayout.length;i++) {
			this.textLayout[2*i]=textLayout[i].start;
			this.textLayout[2*i+1]=textLayout[i].length;
		}
		this.oldCommands=oldCommands;
		this.currentPath=currentPath;
	}
	
	public String getText() {
		return text;
	}

	public int[] getTextLayout() {
		return textLayout;
	}

	public List<String> getOldCommands() {
		return oldCommands;
	}

	public File getCurrentPath() {
		return currentPath;
	}
}
